using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetNuke;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Services.Localization;
using DotNetNuke.Services.Exceptions;
using DotNetNuke.Security;
using gdlmo.DNN.Modules.Article.Business;
using DotNetNuke.Security.Roles;

namespace gdlmo.DNN.Modules.Article
{
	public abstract class AccesoryShow : PortalModuleBase
	{	

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{			
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		#region Event Handlers

		private void Page_Load(object sender, System.EventArgs e)
		{
			try 
			{		
				int AccesoryId = Convert.ToInt32(Request["AccesoryId"].ToString());				
				if (!Page.IsPostBack) 
				{
					AccesoryController objCtl = new AccesoryController();
					AccesoryInfo objInfo = objCtl.Get(AccesoryId);					
					Response.Redirect(gdlmoGlobal.GetMyURL(objInfo.ArticleName));	
				}				
			} 
			catch (Exception exc) 
			{
				Exceptions.ProcessModuleLoadException(this, exc);
			}
		}
		#endregion		
	}
}